package com.Tokiu.config;

import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.mapper.MapperFactoryBean;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.PlatformTransactionManager;


import javax.sql.DataSource;



public class MybatisConfig {

    @Bean
    public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource){
        SqlSessionFactoryBean ssfb=new SqlSessionFactoryBean();

        ssfb.setTypeAliasesPackage("com.Tokiu.pojo");

        ssfb.setDataSource(dataSource);

        return ssfb;
    }

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer mmb=new MapperScannerConfigurer();

        mmb.setBasePackage("com.Tokiu.mapper");

        return mmb;
    }

//    public PlatformTransactionManager
}
